<?php
use think\facade\Route;

// 为v1/Test控制器添加路由
Route::group('v1', function() {
    Route::get('warehouse/hello/:name', 'v1.Warehouse/hello');

    Route::post('warehouse', 'v1.Warehouse/createShelf');//批量增加货架层
    Route::post('addshelye', 'v1.Warehouse/createShelye');//新增一个货架层
    Route::delete('warehouse', 'v1.Warehouse/delete');//根据传入的ids删除
    Route::put('warehouse', 'v1.Warehouse/update');//修改货架层
    Route::put('setwhstatus', 'v1.Warehouse/switchStatus');//切换货架层状态
    Route::get('warehouse', 'v1.Warehouse/list');//分页查询

    //快递部分
    Route::get('explists', 'v1.Express/list');    //快递入库
    Route::post('express', 'v1.Express/create');    //快递入库
    Route::put('express', 'v1.Express/update');    //更新快递状态

    //管理员登录
    Route::post('token/app', 'v1.Token/getAppToken');

    // RESTful风格路由
//    Route::resource('test', 'v1.Test');
})->middleware(\app\cms\middleware\Cors::class);  // 指定中间件